﻿using System;

namespace ArrayReverse
{
    class Program
    {
        static void Main(string[] args)
        {
            // swap two numbers
            int x = 5;
            int y = 7;

            int t = x;
            x = y;
            y = t;


            // Reverse array
            string[] names = new string[] { "Bob", "Alice", "John", "Vardan", "Galust" };
            string temp;

            Console.WriteLine("------ Before Reverse");
            for (int i = 0; i < names.Length; i++)
            {
                Console.WriteLine(names[i]);
            }

            for (int i = 0; i < names.Length / 2; i++)
            {
                temp = names[i];
                names[i] = names[names.Length - i - 1];
                names[names.Length - i - 1] = temp;
            }

            Console.WriteLine("------ After Reverse");
            for (int i = 0; i < names.Length; i++)
            {
                Console.WriteLine(names[i]);
            }
        }
    }
}
